<template>
  <div>
    <el-form class="gtd" :model="ruleForm" >
      <div class="gtd-t">
        <el-form-item label-width="120px">
          <el-avatar
            class="header"
            :src="ruleForm.UserHeadPhoto"
          ></el-avatar>
          <!-- <template slot-scope="scope">
          <el-image :src="scope.row."></el-image>
          </template> -->
        </el-form-item>
      </div>
      <div class="gtd-b">
        <el-form-item label="团长姓名：" label-width="120px">{{
          ruleForm.SalesManName
        }}</el-form-item>
        <el-form-item label="手机号：" label-width="120px">{{
          ruleForm.SalesManPhone
        }}</el-form-item>
        <el-form-item label="推荐人：" label-width="120px" prop="InviteBySalesManName"></el-form-item>
      </div>
      <div>
        <el-form-item label="申请时间：" label-width="120px">{{
          ruleForm.CreateTime
        }}</el-form-item>
      </div>
    </el-form>
    <el-form class="gtd-bot" :model="ruleForm">
      <el-row>
        <el-col :span="8">
          <el-form-item
            label="启动社小龙次数："
            label-width="220px"
          >{{ ruleForm.StartAppCount }}</el-form-item>
        </el-col>
          <el-col :span="8">
          <el-form-item label="发布商品数：" label-width="220px">{{ ruleForm.ProductCount }}</el-form-item>
          </el-col>
          <el-col :span="8">
          <el-form-item label="发布活动数：" label-width="220px">{{ ruleForm.GBProductCount }}</el-form-item>
          </el-col>
      </el-row>
      <el-row>
        <el-col :span="8">
          <el-form-item label="可提现余额：￥" label-width="220px">{{ ruleForm.Balance }}</el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item
            label="已提现金额：￥"
            label-width="220px"
          >{{ ruleForm.TakeAmount }}</el-form-item>
        </el-col>  
        <el-col :span="8">
          <el-form-item label="推广次数：" label-width="220px">{{ ruleForm.UsersShareCount }}</el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="8">
           <el-form-item label="销售订单数：" label-width="220px">{{ ruleForm.OrderCount }}</el-form-item>
        </el-col>
        <el-col :span="8">
           <el-form-item label="购买订单数：" label-width="220px">{{ ruleForm.BuyOrderCount }}</el-form-item>
        </el-col>
      </el-row>
    </el-form>
    <el-button style="margin: 10px 0 0 50%" type="info" @click="goback"
      >返回</el-button
    >
  </div>
</template>

<script>
import { SalesManInfo } from "@/request/api";
export default {
  data() {
    return {
      ruleForm: {},
      sid: null,
    };
  },
  methods: {
    getInfo() {
      this.sid = this.$route.query.detail;
      SalesManInfo({
        SId : this.sid
      })
      .then( res => {
        if( res.StatusCode === 200 ) {
          this.ruleForm = res.Data
        }
        console.log(this.ruleForm)
      }).catch( err => {console.log(err)})
    },
    goback() {
      this.$router.back();
    },
  },
  created() {
    this.getInfo();
  },
};
</script>

<style lang="less" scoped>
.gtd {
  width: 96%;
  margin: 0 auto;
  display: flex;
  justify-content: space-around;
  background-color: #fff;
  .header {
    border: 1px solid black;
    width: 65px;
    height: 65px;
    margin-top: 25px;
  }
  .gtd-b {
    display: flex;
    flex-direction: column;
  }
}
.gtd-bot {
  width: 96%;
  margin: 50px auto;
  background-color: #fff;
}
</style>